import { defineStore } from 'pinia'
import { loginAPi } from '@/api'
export const useUserStore = defineStore('user', {
  state: () => {
    return {
      userInfo: {} //用户信息
    }
  },
  actions: {
    // 登录
    async loginActions(data) {
      const { result } = await loginAPi(data)
      this.userInfo = result
    }
  },
  getters: {},
  // 持久化
  persist: { enabled: true }
})
